﻿using System.Data;
using HtmlAgilityPack;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NFLManager;

namespace NFLManagerTests
{

    /// <summary>
    /// test su DataManager
    /// </summary>
    [TestClass]
    public class tc_DataManager
    {
        private static readonly HtmlWeb _web = new HtmlWeb();

        private static HtmlDocument _doc = new HtmlDocument();

        
        [TestMethod]
        [TestCategory("DataManager")]
        public void Test_PopulateTeamsDataTable()
        {
            var result = new DataManager().PopulateTeamsDataTable();
            Assert.IsNotNull(result, "null returned");
            Assert.IsTrue(result.Rows.Count == 32, "rows count: 32 vs {0} ", result.Rows.Count);
            Assert.IsTrue(result.Rows[0][0].ToString() == "ARI", "first team of list: 'ARI' vs {0}", result.Rows[0][0].ToString());
            Assert.IsTrue(result.Rows[17][0].ToString() == "MIN", "first team of list: 'MIN' vs {0}", result.Rows[17][0].ToString());
            Assert.IsTrue(result.Rows[31][0].ToString() == "WAS", "first team of list: 'WAS' vs {0}", result.Rows[31][0].ToString());
        }

        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetMatchsDataTable()
        {
            var result = new DataManager().Matchs(3, "2000");
            Assert.IsNotNull(result, "null returned");
            Assert.IsTrue(result.Rows[6][1].ToString() == "TB", "away team : 'TB' vs {0}", result.Rows[6][1].ToString());
            Assert.IsTrue(result.Rows[6][2].ToString() == "31", "away score: 31 vs {0}", result.Rows[6][2].ToString());
            Assert.IsTrue(result.Rows[6][3].ToString() == "DET", "home team : 'DET' vs {0}", result.Rows[6][3].ToString());
            Assert.IsTrue(result.Rows[6][4].ToString() == "10", "home score: 10 vs {0}",result.Rows[6][4].ToString());
            result = null;
            result = new DataManager().Matchs(14, "2007");
            Assert.IsNotNull(result, "null returned");
            Assert.IsTrue(result.Rows[0][1].ToString() == "CHI", "away team : 'CHI' vs {0}", result.Rows[0][1].ToString());
            Assert.IsTrue(result.Rows[0][2].ToString() == "16", "away score: 16 vs {0}", result.Rows[0][2].ToString());
            Assert.IsTrue(result.Rows[0][3].ToString() == "WAS", "home team : 'WAS' vs {0}", result.Rows[0][3].ToString());
            Assert.IsTrue(result.Rows[0][4].ToString() == "24", "home score: 24 vs {0}", result.Rows[0][4].ToString());
            result = null;
            result = new DataManager().Matchs(8, "2013");
            Assert.IsNotNull(result, "null returned");
            Assert.IsTrue(result.Rows[11][1].ToString() == "GB", "away team : 'GB' vs {0}", result.Rows[11][1].ToString());
            Assert.IsTrue(result.Rows[11][2].ToString() == "44", "away score: 44 vs {0}", result.Rows[11][2].ToString());
            Assert.IsTrue(result.Rows[11][3].ToString() == "MIN", "home team : 'MIN' vs {0}", result.Rows[11][3].ToString());
            Assert.IsTrue(result.Rows[11][4].ToString() == "31", "home score: 31 vs {0}", result.Rows[11][4].ToString());
        }
        
        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetPlayersDataTable()
        {
            var result = new DataManager().Players("SEA");
            Assert.IsNotNull(result, "null returned");
            var rowIndex = result.Rows.IndexOf(result.Select("NO = '3'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Russell", "name of number 3: 'Russell' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Wilson", "surname of nmber 3: 'Wilson' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "QB", "role of number 3: 'QB' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '25'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Richard", "name of number 25: 'Richard' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Sherman", "surname of nmber 25: 'Sherman' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "CB", "role of number 25: 'CB' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '24'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Marshawn", "name of number 24: 'Marshawn' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Lynch", "surname of nmber 24: 'Lynch' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "RB", "role of number 24: 'RB' vs {0}", result.Rows[rowIndex][4].ToString());
            result = null;
            result = new DataManager().Players("TB");
            Assert.IsNotNull(result, "null returned");
            rowIndex = result.Rows.IndexOf(result.Select("NO = '22'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Doug", "name of number 22: 'Doug' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Martin", "surname of nmber 22: 'Martin' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "RB", "role of number 22: 'RB' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '93'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Gerald", "name of number 93: 'Gerald' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "McCoy", "surname of nmber 93: 'McCoy' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "DT", "role of number 93: 'DT' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '83'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Vincent", "name of number 83: 'Vincent' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Jackson", "surname of nmber 83: 'Jackson' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "WR", "role of number 83: 'WR' vs {0}", result.Rows[rowIndex][4].ToString());
            result = null;
            result = new DataManager().Players("PHI");
            Assert.IsNotNull(result, "null returned");
            rowIndex = result.Rows.IndexOf(result.Select("NO = '9'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Nick", "name of number 9: 'Nick' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Foles", "surname of nmber 9: 'Foles' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "QB", "role of number 9: 'QB' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '25'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "LeSean", "name of number 25: 'LeSean' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "McCoy", "surname of nmber 25: 'McCoy' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "RB", "role of number 25: 'RB' vs {0}", result.Rows[rowIndex][4].ToString());
            rowIndex = result.Rows.IndexOf(result.Select("NO = '51'")[0]);
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Emmanuel", "name of number 51: 'Emmanuel' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][2].ToString() == "Acho", "surname of nmber 51: 'Acho' vs {0}", result.Rows[rowIndex][2].ToString());
            Assert.IsTrue(result.Rows[rowIndex][4].ToString() == "LB", "role of number 51: 'LB' vs {0}", result.Rows[rowIndex][4].ToString());

        }

        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetInjuriesDataTable()
        {
            var rowIndex = -1;
            var result = new DataManager().Injuries(1);
            Assert.IsNotNull(result, "null returned");

            rowIndex = result.Rows.IndexOf(result.Select("NAME = 'Dennis' AND SURNAME = 'Pitta' AND TEAM = 'BAL'")[0]);
            Assert.IsTrue(rowIndex != -1, "nessuna corrispondenza per Dennis Pitta");
            Assert.IsTrue(result.Rows[rowIndex][0].ToString() == "Dennis", "name: 'Dennis' vs {0}", result.Rows[rowIndex][0].ToString());
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Pitta", "surname: 'Pitta' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][6].ToString() == "BAL", "team: 'BAL' vs {0}", result.Rows[rowIndex][6].ToString());
            result = null;
            result = new DataManager().Injuries(5);
            Assert.IsNotNull(result, "null returned");
            rowIndex = -1;
            rowIndex = result.Rows.IndexOf(result.Select("NAME = 'Ezekiel' AND SURNAME = 'Ansah' AND TEAM = 'DET'")[0]);
            Assert.IsTrue(rowIndex != -1, "nessuna corrispondenza per Ezekiel Ansah");
            Assert.IsTrue(result.Rows[rowIndex][0].ToString() == "Ezekiel", "name: 'Ezekiel' vs {0}", result.Rows[rowIndex][0].ToString());
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Ansah", "surname: 'Ansah' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][6].ToString() == "DET", "team: 'DET' vs {0}", result.Rows[rowIndex][6].ToString());
            result = null;
            result = new DataManager().Injuries(11);
            Assert.IsNotNull(result, "null returned");
            rowIndex = -1;
            rowIndex = result.Rows.IndexOf(result.Select("NAME = 'William' AND SURNAME = 'Tolbert' AND TEAM = 'CAR'")[0]);
            Assert.IsTrue(rowIndex != -1, "nessuna corrispondenza per William Tolbert");
            Assert.IsTrue(result.Rows[rowIndex][0].ToString() == "William", "name: 'William' vs {0}", result.Rows[rowIndex][0].ToString());
            Assert.IsTrue(result.Rows[rowIndex][1].ToString() == "Tolbert", "surname: 'Tolbert' vs {0}", result.Rows[rowIndex][1].ToString());
            Assert.IsTrue(result.Rows[rowIndex][6].ToString() == "CAR", "team: 'CAR' vs {0}", result.Rows[rowIndex][6].ToString());
        }

        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetLeaderDataTable()
        {
            DataTable result = null;
            var rowIndex = -1;


            result = new DataManager().GetLeaderDataTable("http://www.nfl.com/player/russellwilson/2532975/profile");
            Assert.IsNotNull(result, "null returned");

            Assert.IsTrue(result.Rows[0][1].ToString() == "SEA", "team: 'SEA' vs {0}", result.Rows[0][1].ToString());
            Assert.IsTrue(result.Rows[0][2].ToString() == "CAR", "opposite team: 'CAR' vs {0}", result.Rows[0][2].ToString());
            Assert.IsTrue(result.Rows[0][3].ToString() == "AWAY", "AH: 'AWAY' vs {0}", result.Rows[0][3].ToString());
            Assert.IsTrue(result.Rows[0][6].ToString() == "25", "passing_comp: '25' vs {0}", result.Rows[0][6].ToString());
            Assert.IsTrue(result.Rows[0][7].ToString() == "33", "passing_att: '33' vs {0}", result.Rows[0][7].ToString());
            Assert.IsTrue(result.Rows[0][9].ToString() == "320", "passing_yds: '320' vs {0}", result.Rows[0][9].ToString());
            Assert.IsTrue(result.Rows[0][11].ToString() == "1", "passing_td: '1' vs {0}", result.Rows[0][11].ToString());
            Assert.IsTrue(result.Rows[0][12].ToString() == "0", "passing_int: '0' vs {0}", result.Rows[0][12].ToString());
            Assert.IsTrue(result.Rows[0][13].ToString() == "2", "passing_sck: '2' vs {0}", result.Rows[0][13].ToString());
            Assert.IsTrue(result.Rows[0][16].ToString() == "5", "rushing_att: '5' vs {0}", result.Rows[0][16].ToString());
            Assert.IsTrue(result.Rows[0][17].ToString() == "7", "rushing_yds: '7' vs {0}", result.Rows[0][17].ToString());
            Assert.IsTrue(result.Rows[0][19].ToString() == "0", "rushing_td: '0' vs {0}", result.Rows[0][19].ToString());
            Assert.IsTrue(result.Rows[0][22].ToString() == "Russell", "name: 'Russell' vs {0}", result.Rows[0][22].ToString());
            Assert.IsTrue(result.Rows[0][23].ToString() == "Wilson", "surname: 'Wilson' vs {0}", result.Rows[0][23].ToString());
            Assert.IsTrue(result.Rows[0][24].ToString() == "QB", "role: 'QB' vs {0}", result.Rows[0][24].ToString());

            Assert.IsTrue(result.Rows[10][1].ToString() == "SEA", "team: 'SEA' vs {0}", result.Rows[10][1].ToString());
            Assert.IsTrue(result.Rows[10][2].ToString() == "MIN", "opposite team: 'MIN' vs {0}", result.Rows[10][2].ToString());
            Assert.IsTrue(result.Rows[10][3].ToString() == "HOME", "AH: 'HOME' vs {0}", result.Rows[10][3].ToString());
            Assert.IsTrue(result.Rows[10][6].ToString() == "13", "passing_comp: '13' vs {0}", result.Rows[10][6].ToString());
            Assert.IsTrue(result.Rows[10][7].ToString() == "18", "passing_att: '18' vs {0}", result.Rows[10][7].ToString());
            Assert.IsTrue(result.Rows[10][9].ToString() == "230", "passing_yds: '230' vs {0}", result.Rows[10][9].ToString());
            Assert.IsTrue(result.Rows[10][11].ToString() == "2", "passing_td: '2' vs {0}", result.Rows[10][11].ToString());
            Assert.IsTrue(result.Rows[10][12].ToString() == "0", "passing_int: '0' vs {0}", result.Rows[10][12].ToString());
            Assert.IsTrue(result.Rows[10][13].ToString() == "1", "passing_sck: '1' vs {0}", result.Rows[10][13].ToString());
            Assert.IsTrue(result.Rows[10][16].ToString() == "2", "rushing_att: '2' vs {0}", result.Rows[10][16].ToString());
            Assert.IsTrue(result.Rows[10][17].ToString() == "14", "rushing_yds: '14' vs {0}", result.Rows[10][17].ToString());
            Assert.IsTrue(result.Rows[10][19].ToString() == "0", "rushing_td: '0' vs {0}", result.Rows[10][19].ToString());
            Assert.IsTrue(result.Rows[10][22].ToString() == "Russell", "name: 'Russell' vs {0}", result.Rows[10][22].ToString());
            Assert.IsTrue(result.Rows[10][23].ToString() == "Wilson", "surname: 'Wilson' vs {0}", result.Rows[10][23].ToString());
            Assert.IsTrue(result.Rows[10][24].ToString() == "QB", "role: 'QB' vs {0}", result.Rows[10][24].ToString());

            Assert.IsTrue(result.Rows[15][1].ToString() == "SEA", "team: 'SEA' vs {0}", result.Rows[15][1].ToString());
            Assert.IsTrue(result.Rows[15][2].ToString() == "ARI", "opposite team: 'ARI' vs {0}", result.Rows[15][2].ToString());
            Assert.IsTrue(result.Rows[15][3].ToString() == "HOME", "AH: 'HOME' vs {0}", result.Rows[15][3].ToString());
            Assert.IsTrue(result.Rows[15][6].ToString() == "11", "passing_comp: '11' vs {0}", result.Rows[15][6].ToString());
            Assert.IsTrue(result.Rows[15][7].ToString() == "27", "passing_att: '27' vs {0}", result.Rows[15][7].ToString());
            Assert.IsTrue(result.Rows[15][9].ToString() == "108", "passing_yds: '108' vs {0}", result.Rows[15][9].ToString());
            Assert.IsTrue(result.Rows[15][11].ToString() == "1", "passing_td: '1' vs {0}", result.Rows[15][11].ToString());
            Assert.IsTrue(result.Rows[15][12].ToString() == "1", "passing_int: '1' vs {0}", result.Rows[15][12].ToString());
            Assert.IsTrue(result.Rows[15][13].ToString() == "4", "passing_sck: '4' vs {0}", result.Rows[15][13].ToString());
            Assert.IsTrue(result.Rows[15][16].ToString() == "5", "rushing_att: '5' vs {0}", result.Rows[15][16].ToString());
            Assert.IsTrue(result.Rows[15][17].ToString() == "-1", "rushing_yds: '-1' vs {0}", result.Rows[15][17].ToString());
            Assert.IsTrue(result.Rows[15][19].ToString() == "0", "rushing_td: '0' vs {0}", result.Rows[15][19].ToString());
            Assert.IsTrue(result.Rows[15][22].ToString() == "Russell", "name: 'Russell' vs {0}", result.Rows[15][22].ToString());
            Assert.IsTrue(result.Rows[15][23].ToString() == "Wilson", "surname: 'Wilson' vs {0}", result.Rows[15][23].ToString());
            Assert.IsTrue(result.Rows[15][24].ToString() == "QB", "role: 'QB' vs {0}", result.Rows[15][24].ToString());

            rowIndex = result.Rows.IndexOf(result.Select("REGULARSEASON_WK = 12")[0]);
            Assert.IsTrue(rowIndex != -1, "il bye non corrisponde");


            result = null;
            rowIndex = -1;

            result = new DataManager().GetLeaderDataTable("http://www.nfl.com/player/ericdecker/497284/profile");
            Assert.IsNotNull(result, "null returned");

            Assert.IsTrue(result.Rows[3][1].ToString() == "DEN", "team: 'DEN' vs {0}", result.Rows[3][1].ToString());
            Assert.IsTrue(result.Rows[3][2].ToString() == "PHI", "opposite team: 'PHI' vs {0}", result.Rows[3][2].ToString());
            Assert.IsTrue(result.Rows[3][3].ToString() == "HOME", "AH: 'HOME' vs {0}", result.Rows[3][3].ToString());
            Assert.IsTrue(result.Rows[3][6].ToString() == "5", "receiving_rec: '5' vs {0}", result.Rows[3][6].ToString());
            Assert.IsTrue(result.Rows[3][7].ToString() == "88", "receiving_yds: '88' vs {0}", result.Rows[3][7].ToString());
            Assert.IsTrue(result.Rows[3][9].ToString() == "52", "receiving_lng: '52' vs {0}", result.Rows[3][9].ToString());
            Assert.IsTrue(result.Rows[3][10].ToString() == "0", "receiving_td: '0' vs {0}", result.Rows[3][10].ToString());
            Assert.IsTrue(result.Rows[3][22].ToString() == "Eric", "name: 'Eric' vs {0}", result.Rows[3][22].ToString());
            Assert.IsTrue(result.Rows[3][23].ToString() == "Decker", "surname: 'Decker' vs {0}", result.Rows[3][23].ToString());
            Assert.IsTrue(result.Rows[3][24].ToString() == "WR", "role: 'WR' vs {0}", result.Rows[3][24].ToString());

            Assert.IsTrue(result.Rows[7][1].ToString() == "DEN", "team: 'DEN' vs {0}", result.Rows[7][1].ToString());
            Assert.IsTrue(result.Rows[7][2].ToString() == "WAS", "opposite team: 'WAS' vs {0}", result.Rows[7][2].ToString());
            Assert.IsTrue(result.Rows[7][3].ToString() == "HOME", "AH: 'HOME' vs {0}", result.Rows[7][3].ToString());
            Assert.IsTrue(result.Rows[7][6].ToString() == "4", "receiving_rec: '4' vs {0}", result.Rows[7][6].ToString());
            Assert.IsTrue(result.Rows[7][7].ToString() == "42", "receiving_yds: '42' vs {0}", result.Rows[7][7].ToString());
            Assert.IsTrue(result.Rows[7][9].ToString() == "19", "receiving_lng: '19' vs {0}", result.Rows[7][9].ToString());
            Assert.IsTrue(result.Rows[7][10].ToString() == "0", "receiving_td: '0' vs {0}", result.Rows[7][10].ToString());
            Assert.IsTrue(result.Rows[7][22].ToString() == "Eric", "name: 'Eric' vs {0}", result.Rows[7][22].ToString());
            Assert.IsTrue(result.Rows[7][23].ToString() == "Decker", "surname: 'Decker' vs {0}", result.Rows[7][23].ToString());
            Assert.IsTrue(result.Rows[7][24].ToString() == "WR", "role: 'WR' vs {0}", result.Rows[7][24].ToString());

            Assert.IsTrue(result.Rows[15][1].ToString() == "DEN", "team: 'DEN' vs {0}", result.Rows[15][1].ToString());
            Assert.IsTrue(result.Rows[15][2].ToString() == "HOU", "opposite team: 'HOU' vs {0}", result.Rows[15][2].ToString());
            Assert.IsTrue(result.Rows[15][3].ToString() == "AWAY", "AH: 'AWAY' vs {0}", result.Rows[15][3].ToString());
            Assert.IsTrue(result.Rows[15][6].ToString() == "10", "receiving_rec: '10' vs {0}", result.Rows[15][6].ToString());
            Assert.IsTrue(result.Rows[15][7].ToString() == "131", "receiving_yds: '131' vs {0}", result.Rows[15][7].ToString());
            Assert.IsTrue(result.Rows[15][9].ToString() == "35", "receiving_lng: '35' vs {0}", result.Rows[15][9].ToString());
            Assert.IsTrue(result.Rows[15][10].ToString() == "2", "receiving_td: '2' vs {0}", result.Rows[15][10].ToString());
            Assert.IsTrue(result.Rows[15][22].ToString() == "Eric", "name: 'Eric' vs {0}", result.Rows[15][22].ToString());
            Assert.IsTrue(result.Rows[15][23].ToString() == "Decker", "surname: 'Decker' vs {0}", result.Rows[15][23].ToString());
            Assert.IsTrue(result.Rows[15][24].ToString() == "WR", "role: 'WR' vs {0}", result.Rows[15][24].ToString());

            rowIndex = result.Rows.IndexOf(result.Select("REGULARSEASON_WK = 9")[0]);
            Assert.IsTrue(rowIndex != -1, "il bye non corrisponde");
            
            
            result = null;
            rowIndex = -1;

            result = new DataManager().GetLeaderDataTable("http://www.nfl.com/player/j.j.jansen/2507412/profile");
            Assert.IsNotNull(result, "null returned");

            Assert.IsTrue(result.Rows[3][1].ToString() == "DEN", "team: 'DEN' vs {0}", result.Rows[3][1].ToString());
            Assert.IsTrue(result.Rows[3][2].ToString() == "PHI", "opposite team: 'PHI' vs {0}", result.Rows[3][2].ToString());
            Assert.IsTrue(result.Rows[3][3].ToString() == "HOME", "AH: 'HOME' vs {0}", result.Rows[3][3].ToString());
            Assert.IsTrue(result.Rows[3][6].ToString() == "5", "receiving_rec: '5' vs {0}", result.Rows[3][6].ToString());
            Assert.IsTrue(result.Rows[3][7].ToString() == "88", "receiving_yds: '88' vs {0}", result.Rows[3][7].ToString());
            Assert.IsTrue(result.Rows[3][9].ToString() == "52", "receiving_lng: '52' vs {0}", result.Rows[3][9].ToString());
            Assert.IsTrue(result.Rows[3][10].ToString() == "0", "receiving_td: '0' vs {0}", result.Rows[3][10].ToString());
            Assert.IsTrue(result.Rows[3][22].ToString() == "Eric", "name: 'Eric' vs {0}", result.Rows[3][22].ToString());
            Assert.IsTrue(result.Rows[3][23].ToString() == "Decker", "surname: 'Decker' vs {0}", result.Rows[3][23].ToString());
            Assert.IsTrue(result.Rows[3][24].ToString() == "WR", "role: 'WR' vs {0}", result.Rows[3][24].ToString());


            rowIndex = result.Rows.IndexOf(result.Select("REGULARSEASON_WK = 9")[0]);
            Assert.IsTrue(rowIndex != -1, "il bye non corrisponde");
            
            
            result = null;
            result = new DataManager().GetLeaderDataTable("http://www.nfl.com/player/georgewilson/2505745/profile");
            Assert.IsNotNull(result, "null returned");
            
            
            result = null;
            result = new DataManager().GetLeaderDataTable("http://www.nfl.com/player/calebsturgis/2539637/profile");
            Assert.IsNotNull(result, "null returned");
        }

        //[TestMethod]
        //[TestCategory("DataManager")]
        //public void test_GetLeadersDataTable()
        //{
        //    var result = DataManager.Leaders();
        //    Assert.IsNotNull(result);
        //}

        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetTeamsFromDB()
        {
            var result = DataManager.GetTeamsFromDB();
            Assert.IsNotNull(result);
        }

        [TestMethod]
        [TestCategory("DataManager")]
        public void test_GetUrlsFromPlayersTableDB()
        {
            var result = DataManager.GetUrlsFromPlayersTableDB();
            Assert.IsNotNull(result);
        }
    }
}
